<template>
  <div class="pad10 tac fs16 w100">
    <div class="tac fs14">欢迎使用 订单生产排期系统 </div>
    <div ref="echarts" style="width: 100%;height: 300px;">loading</div>
    <div ref="echartsWeek" style="width: 100%;height: 300px;">loading</div>
    <div ref="echartsPoint" style="width: 100%;height: 300px;">loading</div>
  </div>
</template>

<script>
import Layout from './layout'
import tree from '@/components/FormItem/tree'
import echarts from 'echarts'
import chart from "../../assets/js/chart";

export default {
  name: 'welcome',
  components:{tree},
  data () {
    return {
      docked: true,
      open: true,
      position: 'left'
    }
  },
  comments: { Layout },
  methods: {

  },
  created () {
    this.$progress.start()
  },
  mounted () {
    this.$progress.done()

    this.$api.get('/admin/Stream/welcome',{},(res)=>{

      var myChart = echarts.init(this.$refs.echarts);
      // 绘制图表
      myChart.setOption(chart.createBar(res.d.order7d.title,res.d.order7d.label,res.d.order7d.data,res.d.order7d.tooltip));

      var myChartWeek = echarts.init(this.$refs.echartsWeek);
      // 绘制图表
      myChartWeek.setOption(chart.createBar(res.d.order7w.title,res.d.order7w.label,res.d.order7w.data,res.d.order7w.tooltip));

      var myChartPoint = echarts.init(this.$refs.echartsPoint);
      // 绘制图表
      myChartPoint.setOption(chart.createBarArray(res.d.point.title,res.d.point.label,res.d.point.data));

    })
  }
}




</script>

<style scoped>

</style>
